module message.Constants;

enum MsgServerName = "msgserver";
enum LogicClientName = "logicClient";
enum MsgClientName = "msgClient";

enum MESSAGE : uint {
  CMD_ZERO = 0,
  CMD_PING = 1,
  CMD_PONG = 2,

  CMD_CHAT_MAP_ACTION = 50,
  CMD_GROUP_MEMBER_CHANGE_HASH = 51,

  CMD_AUTHORIZE_REQ = 101,
  CMD_AUTHORIZE_RES = 102,
  CMD_CONTACTS_REQ = 103,
  CMD_CONTACTS_RES = 104,
  CMD_UNRECEIVE_REQ = 105,
  CMD_UNRECEIVE_RES = 106,
  CMD_PUT_UNRECEIVE = 107,
  CMD_MESSAGE_TRANSFER = 108,

  CMD_MESSAGE_TRANSFER_HASH = 109,
  CMD_MESSAGE_ACK = 110,
  CMD_NOTIFY_TRANSFER = 112,
  CMD_NOTIFY_ACK = 114,
  CMD_REFRESH_PROFILE_REQ = 115,
  CMD_REFRESH_PROFILE_RES = 116,
  CMD_SEARCH_USER_REQ = 117,
  CMD_SEARCH_USER_RES = 118,
  CMD_APPLY_FRIEND_REQ = 119,
  CMD_APPLY_FRIEND_RES = 120,
  CMD_DEAL_FRIEND_REQ = 121,
  CMD_DEAL_FRIEND_RES = 122,
  CMD_DELETE_FRIEND_REQ = 123,
  CMD_DELETE_FRIEND_RES = 124,

  CMD_OFFLINE = 125,

  CMD_INITCHATMAP = 126,
  CMD_CHATMAP = 127,
  CMD_PUT_UNNOTICE = 128,
  CMD_GREATE_GROUP_REQ = 129,
  CMD_JOIN_GROUP = 130,
  CMD_INVITE_GROUP = 131,
  CMD_OFFLINE_INVITE_GROUP = 132,

  CMD_GROUP_INVITATION = 134,

  CMD_LEAVE_GROUP = 135,

  CMD_GROUP_MEMBER_CHANGE = 136,

  CMD_APPLY_GROUP = 139,

  CMD_SET_GROUP_NAME_REQ =  143,

  CMD_SET_GROUP_NAME_RES =  144,

  CMD_SET_GROUP_NAME_HASH_RES =  145,

  CMD_PUT_HISTORY_MSG = 170,

  CMD_SET_MSG_READ_REQ = 180,

  CMD_SET_MSG_READ_RES = 181,
  CMD_SEARCH_BY_IDS_REQ  =  182,
  CMD_SEARCH_BY_IDS_RES  =  183,

  CMD_REGISTER_GATESERVER = 201,
  CMD_REGISTER_MSGSERVER = 202,
  CMD_REGISTER_LOGICSERVER = 203,
  CMD_RPC_REQUEST = 10000,
  CMD_RPC_RESPONST = 10001
}

struct ClientExtend
{
  uint requestId;
  uint responseId;
}

struct ServerExtend
{
  uint requestId;
  uint responseId;
  ulong userId;
  ubyte[128] userIp;
}
